<?php

require ('class/config.php');

$lokasi  = mysql_query("select * from `kegiatan`");
$gambar1 = mysql_query("select monitoring.foto from `monitoring` where progres = '25' andmonitoring.idkegiatan='".$l['idkegiatan']."'");
$gambar2 = mysql_query("select monitoring.foto from `monitoring` where progres = '50' and monitoring.idkegiatan='".$l['idkegiatan']."'");
$gambar3 = mysql_query("select monitoring.foto from `monitoring` where progres = '75' andmonitoring.idkegiatan='".$l['idkegiatan']."'");
$gambar3 = mysql_query("select monitoring.foto from `monitoring` where progres = '100' andmonitoring.idkegiatan='".$l['idkegiatan']."'");

$o .= '<ul>';
while($l=mysql_fetch_array($lokasi)){
	$o .=  "<li><a href=\"javascript:setpeta(".$l['lat'].",".$l['long'].",".$l['idkegiatan'].")\">".$l['nama_kegiatan']."</a></li>";
	$o .= "<span id=\"".$l['idkegiatan']."\" style=\"display:none\">";
	$o .= '<h2>'.$l['nama_kegiatan'].'</h2>
			<div id="tabs">
				<ul>
					<li><a href="#tabs-1">Detail Kegiatan</a></li>
					<li><a href="#tabs-2">Gambar</a></li>
					<li><a href="#tabs-3">Third</a></li>
				</ul>
				<div id="tabs-1">
				<table border="0" cellpadding="2" cellspacing="2">
				<tr>
					<td>Nama Kegiatan</td><td>: '.$l['nama_kegiatan'].'</td>
				</tr>
				<tr>
					<td>Sektoral</td><td>: '.$l['idsektoral'].'</td>
				</tr>
				<tr>
					<td>Kabupaten</td><td>: '.$l['idkabkota'].'</td>
				</tr>
				<tr>
					<td>Pagu</td><td>: '.$l['pagu'].'</td>
				</tr>
				</table>
				</div>
				<div id="tabs-2">';
					if ($gambar1) {
						$o .= "<h2>Progress Kegiatan : 25%<h2>";
						while ($i = mysql_fetch_array($gambar1)) {
							$o .= "<img src='file/thumbnail/".$i['foto']."'>";
						}
						$o .= "<br><br>";
					} else {
						$o .= "<h1>Belum Ada Progres<h1>";
					} 

					if ($gambar2) {
						$o .= "<h2>Progress Kegiatan : 50%<h2>";
						while ($s = mysql_fetch_array($gambar2)) {
							$o .= "<img src='file/thumbnail/".$s['foto']."'>";
						}
						$o .= "<br><br>";
					} else {
						$o .= "<h1>Belum Ada Progres<h1><br><br>";
					}
					
	$o .= '
				</div>
				<div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
			</div>
	
		  ';
	
	$o .= "</span>";
}
$o .= '</ul>';
echo $o;
?>
